#include "ThreadPool.hpp"
#include <time.h>

int main()
{
    srand(time(nullptr) ^ getpid());
    EnableConsoleLogStrategy();

    std::unique_ptr<ThreadPool<Task>> tp = std::make_unique<ThreadPool<Task>> (5);

    tp->Start();
    //生产数据
    int count = 10;
    while(count--)
    {
        int x = rand()%100+1;
        int y = rand()%10+1;
        Task t(x,y);

        //push到进程池
        tp->Enqueue(t);
        sleep(1);
    }
    tp->Stop();
    tp->Wait();

    return 0;
}